import Schemas from '../schemas';
import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/meteor';

const Channels = new Mongo.Collection('channels');

Channels.attachSchema(Schemas.Channel);

// 检查频道ID是否被占用
const checkChannelId = (id) => {
  const results = Channels.find({channelId: id});

  if (results.count() === 1) {
    return false;
  }

  return true;
};

export { Channels, checkChannelId };